import '@babel/polyfill'
import Vue from 'vue'
import ElementUI from 'element-ui'

import '@/lin/mixin'
import '@/lin/filter'
import '@/lin/plugins'
import '@/lin/directives'

import router from '@/router'
import store from '@/store'
import App from '@/App.vue'

import StickyTop from '@/components/base/sticky-top/sticky-top'
import LIcon from '@/components/base/icon/lin-icon'
import SourceCode from '@/components/base/source-code/source-code'

import CollapseTransition from 'element-ui/lib/transitions/collapse-transition'

import '@/assets/styles/index.scss' // eslint-disable-line
import '@/assets/styles/realize/element-variables.scss'
import axios from 'axios'
import VueSocketIO from 'vue-socket.io'

axios.defaults.baseURL = '/'

Vue.config.productionTip = false

Vue.use(ElementUI)

Vue.use(new VueSocketIO({
  debug: true,
  // 本地调试
  // connection: 'http://127.0.0.1:5005/',
  // 线上部署
  connection: '/',
}))
Vue.component(CollapseTransition.name, CollapseTransition)

// base 组件注册
Vue.component('sticky-top', StickyTop)
Vue.component('l-icon', LIcon)
Vue.component('source-code', SourceCode)

/* eslint no-unused-vars: 0 */
const AppInstance = new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')

// 设置 App 实例
window.App = AppInstance
